package com.fbli.service.Impl;

import com.fbli.mapper.FeedbackMapper;
import com.fbli.pojo.Feedback;
import com.fbli.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

@Service
public class FeedbackServiceImpl implements FeedbackService {
    @Autowired
    private FeedbackMapper feedbackMapper;
    @Override
    public void insertFeedback(Feedback feedback) {
        String username = SecurityContextHolder.getContext().getAuthentication().getName();
        feedback.setUsername(username);
        feedbackMapper.insertFeedback(feedback);
    }
}
